package com.example.materialviewpagerdemo.view;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.materialviewpagerdemo.R;

public class RecyclerViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener
{
    public TextView itemName;
    public TextView itemData;
    public ImageView itemImg;
    private OnItemClickListener mListener;
    public RecyclerViewHolder(View itemView, final OnItemClickListener listener) {
        super(itemView);
        mListener=listener;
        itemView.setOnClickListener(this);
        itemImg=itemView.findViewById(R.id.item_img);
        itemName=itemView.findViewById(R.id.data_name);
        itemData=itemView.findViewById(R.id.data_content);
        System.out.println("listener3");

    }

    @Override
    public void onClick(View v) {
        mListener.onItemClick(v, getAdapterPosition());
        System.out.println("listener2");
    }
}
